#pragma once

#include <windows.h>
#include <xnamath.h>
#include <string>

struct PosVertex 
{
	XMFLOAT3 Pos;
	XMFLOAT3 Normal;
	XMFLOAT2 TexCoord;
	XMFLOAT3 Tangent;
	XMFLOAT3 Weights;
	byte	BoneIndices[4];
};

struct Material
{
	Material() { ZeroMemory(this, sizeof(this)); }
	XMFLOAT4 Ambient;
	XMFLOAT4 Diffuse;
	XMFLOAT4 Specular; // w = SpecPower
};

struct M3dMaterial
{
	Material Mat;
	bool AlphaClip;
	std::wstring DiffuseMapName;
	std::wstring NormalMapName;

};

struct Subset
{
	Subset(): Id(-1), VertexCount(0), vertexStart(0), FaceCount(0), FaceStart(0) {}

	UINT Id;
	UINT VertexCount;
	UINT vertexStart;
	UINT FaceCount;
	UINT FaceStart;
};

struct DirectionalLight
{
	DirectionalLight() { ZeroMemory(this, sizeof(this)); }
	XMFLOAT4 Ambient;
	XMFLOAT4 Diffuse;
	XMFLOAT4 Specular;
	XMFLOAT3 Direction;
	float Pad; // Pad the last float so we can
	// array of lights if we wanted.
};

struct CBPerObject
{
	XMMATRIX mWorld;
	XMMATRIX mWorldInvTrans;
	Material mMat;
};

struct CBViewProj
{
	XMMATRIX mView;
	XMMATRIX mProj;
};

struct CBPerFrame
{
	DirectionalLight mDirectionalLight;
	XMFLOAT3 mEyePos;
	float pad;
};

#define MAXBONES 96
struct CBBoneTransforms
{
	XMMATRIX mBoneTransforms[MAXBONES];
};

struct SimpleVertex
{
	XMFLOAT3 Pos;  // Position
	XMFLOAT2 Tex;
};

struct Vertex2d
{
	int x, y;
};
struct Polygon2d
{
public:
	Polygon2d(int s, int n, int xc, int yc) : state(s), numVerts(n), x0(xc), y0(yc)
	{
		vlist = new Vertex2d[numVerts];
	}
	~Polygon2d()
	{
		delete vlist;
	}
	int state;
	int numVerts;
	int x0, y0;
	//XMFLOAT4 color;
	Vertex2d *vlist;
};

struct ConstantBuffer
{
	XMMATRIX mWorld;
	XMMATRIX mWorldInvTrans;
	XMMATRIX mView;
	XMMATRIX mProjection;
};

